package com.lijing.mock.services;

import com.lijing.mock.manager.UrlMockManager;
import com.lijing.mock.model.ServerResult;
import com.lijing.mock.model.bo.UrlMockBO;
import com.lijing.mock.model.dto.UrlMockDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * mock配置信息服务
 * @author by lijing
 * @date 2019/12/6 0006 11:12
 */
@Slf4j
@Service
public class MockConfigServer {

    private final UrlMockManager urlMockManager;

    public MockConfigServer(UrlMockManager urlMockManager) {
        this.urlMockManager = urlMockManager;
    }

    /**
     * 新增或更新url mock配置信息
     * @param urlMockBO url mock配置信息
     * @return 新增或者更新结果
     */
    public ServerResult<UrlMockBO> addAndUpdate(UrlMockBO urlMockBO){
        return urlMockManager.saveOrUpdate(urlMockBO);
    }



}
